home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / arcers / detar11.zip / DETAR.H < prev   
Text File  |  1988-01-23  |  2KB  |  81 lines

  1. /*
  2.  *    MSDOS TAR Extractor
  3.  */
  4.  
  5. #define    RECORDSIZE    512
  6. #define    NAMSIZ        100
  7. #define    TUNMLEN        32
  8. #define    TGNMLEN        32
  9.  
  10. /*
  11.  *    Header block on tape.
  12.  *
  13.  *    no byte swapping
  14.  */
  15.  
  16. union record {
  17.     char    charptr[RECORDSIZE];
  18.     struct    {
  19.         char    name[NAMSIZ];
  20.         char    mode[8];
  21.         char    uid[8];
  22.         char    gid[8];
  23.         char    size[12];
  24.         char    mtime[12];
  25.         char    chksum[8];
  26.         char    linkflag;
  27.         char    linkname[NAMSIZ];
  28.         char    magic[8];
  29.         char    uname[TUNMLEN];
  30.         char    gname[TGNMLEN];
  31.         char    devmajor[8];
  32.         char    devminor[8];
  33.     } header;
  34. };
  35.  
  36. #define    CHKBLANKS    "        "    /* Checksum: 8 blanks, no null */
  37. #define    TMAGIC        "ustar  "    /* Majic: 7 bytes and a null */
  38.  
  39. /* The linkflag defines the type of file */
  40.  
  41. #define    LF_OLDNORMAL    '\0'        /* Normal disk file, Unix compat */
  42. #define    LF_NORMAL    '0'        /* Normal disk file */
  43. #define    LF_LINK        '1'        /* Link to previously dumped file */
  44. #define    LF_SYMLINK    '2'        /* Symbolic link */
  45. #define    LF_CHR        '3'        /* Character special file */
  46. #define    LF_BLK        '4'        /* Block special file */
  47. #define    LF_DIR        '5'        /* Directory */
  48. #define    LF_FIFO        '6'        /* FIFO special file */
  49. #define    LF_CONTIG    '7'        /* Contiguous file */
  50.  
  51. /*
  52.  *    Unix Stat Header (K&R)
  53.  *
  54.  */
  55.  
  56. struct    stat  {
  57.     int    st_dev;
  58.     int    st_ino;
  59.     int    st_mode;
  60.     int    st_nlink;
  61.     int    st_uid;
  62.     int    st_gid;
  63.     int    st_rdev;
  64.     long    st_size;
  65.     long    st_atime;
  66.     long    st_mtime;
  67.     long    st_ctime;
  68. };
  69.  
  70. #define    S_IFMT        0160000
  71. #define    S_IFDIR        0040000
  72. #define    S_IFCHR        0020000
  73. #define    S_IFBLK        0060000
  74. #define    S_IFREG        0100000
  75. #define    S_ISUID        0004000
  76. #define    S_ISGID        0002000
  77. #define    S_ISVTX        0001000
  78. #define    S_IREAD        0000400
  79. #define    S_IWRITE    0000200
  80. #define    S_IEXEC        0000100
  81.